<template>
  <div id="app">
    <!-- 显示的是当前路由地址所对应的内容 -->
    <!-- exclude="Detail"  指当前Detail组件路由不被缓存 -->
    <!-- <keep-alive exclude="Detail" v-if = "isRouterAlive">
    <router-view/>
    </keep-alive> -->
    <keep-alive v-if = "isRouterAlive">
      <router-view/>
    </keep-alive>
  </div>
</template>

<script>
export default {
  name: 'App',
  provide () {
    return {
      reload: this.reload
    } 
  },
  data () {
    return {
      isRouterAlive: true
    }
  },
  methods: {
    reload () {
      this.isRouterAlive = false
      this.$nextTick(function () {
          this.isRouterAlive = true
      })
    }
  }
}
</script>

<style>
#id{
    height: 100%;
} 
</style>
